package com.augurit.common.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 模块Entity类
 *
 */
@Entity
@Table(name = "AC_MODULE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class AcModule {

	//属性
	private Long moduleId;			//主键ID
	private String moduleCode;		//模块编号
	private String moduleName;		//模块名称
	private String moduleType;		//模块类别
	private Long appId;				//所属应用ID
	private Long parentModuleId;	//父模块ID
	private Integer moduleLevel;	//模块层次
	private String moduleSeq;		//模块序列
	private String isLeaf;			//是否叶子节点。0为非叶子节点，1为叶子节点
	private Integer subCount;		//子节点数
	private String remark;			//备注
	
	@Id
    @SequenceGenerator(name="SEQ_AC_MODULE", sequenceName="SEQ_AC_MODULE", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_AC_MODULE")
	public Long getModuleId() {
		return moduleId;
	}

	public void setModuleId(Long moduleId) {
		this.moduleId = moduleId;
	}

	public String getModuleCode() {
		return moduleCode;
	}

	public void setModuleCode(String moduleCode) {
		this.moduleCode = moduleCode;
	}

	public String getModuleName() {
		return moduleName;
	}

	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}

	public String getModuleType() {
		return moduleType;
	}

	public void setModuleType(String moduleType) {
		this.moduleType = moduleType;
	}

	public Long getAppId() {
		return appId;
	}

	public void setAppId(Long appId) {
		this.appId = appId;
	}

	public Long getParentModuleId() {
		return parentModuleId;
	}

	public void setParentModuleId(Long parentModuleId) {
		this.parentModuleId = parentModuleId;
	}

	public Integer getModuleLevel() {
		return moduleLevel;
	}

	public void setModuleLevel(Integer moduleLevel) {
		this.moduleLevel = moduleLevel;
	}

	public String getModuleSeq() {
		return moduleSeq;
	}

	public void setModuleSeq(String moduleSeq) {
		this.moduleSeq = moduleSeq;
	}

	public String getIsLeaf() {
		return isLeaf;
	}

	public void setIsLeaf(String isLeaf) {
		this.isLeaf = isLeaf;
	}

	public Integer getSubCount() {
		return subCount;
	}

	public void setSubCount(Integer subCount) {
		this.subCount = subCount;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}